<?php foreach($tables as $item): ?>
<li>
    <a class="<?php echo ($item->active == true) ? 'active' : '' ?>" href="javascript:void('')" onclick="get_table('<?=$item->id?>')"><?php echo $item->name ?></a>
</li>
<?php endforeach ?>